package structural.decorator;

/**
 * 加糖
 *
 * @author binbin
 * @since 2022/10/6 19:32
 */
public class SugarExtra extends Coffee {

    Coffee coffee;

    public SugarExtra(Coffee coffee) {
        this.coffee = coffee;
    }

    @Override
    double cost() {
        return coffee.cost() + 0.5;
    }

    @Override
    String desc() {
        return coffee.desc() + ", 加1份糖";
    }
}
